package com.atguigu2.two;

/**
 * 二维数组的基本使用（难点）
 *
 * @author 尚硅谷-宋红康
 * @create 13:08
 */
public class TwoArrayTest {
	public static void main(String[] args) {
		//1. 数组的声明与初始化
     int[][] arr =new int[][]{{1,2,3},{4,5},{6,7}};
     int[][] arr1 = {{1,2,3},{4,5},{6,7}};;
	 int[][] arr2 = new int[4][5];
	 int[][] arr3 = new int[4][];


		//3. 数组的长度
		 //arr.length
		//arr[i].length

		//4. 如何遍历数组
		for (int i = 0; i < arr.length; i++) {
			for (int j = 0; j < arr[i].length; j++) {
				System.out.print(arr[i][j] + " ");
			}
			System.out.println();
		}



	}
}
